Skip to content

fix(dashboard): stabilize add panel flyout group order and count assertions#268197

Closed
gsoldevila wants to merge 1 commit into
elastic:mainfrom
gsoldevila:fix/dashboard-add-panel-flyout-group-order-flakiness
Closed

fix(dashboard): stabilize add panel flyout group order and count assertions#268197
gsoldevila wants to merge 1 commit into
elastic:mainfrom
gsoldevila:fix/dashboard-add-panel-flyout-group-order-flakiness

Conversation

@gsoldevila
Copy link
Copy Markdown
Member

@gsoldevila gsoldevila commented May 7, 2026

Summary

Fixes the two issues that caused the test to be skipped in #268101.

1. Group ordering flakiness

mlGroup and logs-aiopsGroup both define no explicit order in their PresentableGroup definition, so both get order: 0 inside getMenuItemGroups. When two groups tie on order, Array.sort produces a non-deterministic result — their relative DOM position depends on async action registration order, which varies across CI runs.

Fix: sort both arrays before comparing, so the test verifies that the correct set of groups exists without being sensitive to tie-broken ordering.

2. Wrong expected panel count for ES serverless

config/serverless.es.yml sets xpack.ml.ad.enabled: false. The three Anomaly Detection actions (create-anomaly-swimlane, create-anomaly-charts, create-single-metric-viewer) all call checkPermissionAsync(getStartServices, 'canGetJobs') in their isCompatible check. With AD disabled, all three return false and are excluded from the flyout — 17 panels, not 20.

security serverless has xpack.ml.ad.enabled: true, so it correctly gets 20. The previous test code grouped es and security under the same expected values. Fix: split them.

Related

@gsoldevila gsoldevila added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels May 7, 2026
@gsoldevila gsoldevila marked this pull request as ready for review May 7, 2026 13:43
@gsoldevila gsoldevila requested a review from a team as a code owner May 7, 2026 13:43
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/kibana-core (Team:Core)

…rtions

Two separate issues caused this test to be skipped (see elastic#268101):

1. Group ordering: mlGroup and logs-aiopsGroup both default to order 0 in
   getMenuItemGroups, making their relative DOM position non-deterministic
   (depends on async action registration order). Sort both arrays before
   comparing so the test verifies group presence without relying on
   tie-broken ordering.

2. Panel count for ES serverless: xpack.ml.ad.enabled is false in
   config/serverless.es.yml, so the 3 Anomaly Detection actions
   (swim lane, anomaly charts, single metric viewer) fail their
   isCompatible check (canGetJobs) and are excluded from the flyout.
   The expected count for the 'es' project type is 17, not 20. Split
   the 'es' and 'security' cases in getExpected to reflect this.

Fixes elastic#268101

Co-authored-by: Cursor <cursoragent@cursor.com>
@gsoldevila gsoldevila force-pushed the fix/dashboard-add-panel-flyout-group-order-flakiness branch from fae143f to ab97e96 Compare May 7, 2026 14:29
@gsoldevila gsoldevila changed the title fix(dashboard): stabilize add panel flyout group order assertion fix(dashboard): stabilize add panel flyout group order and count assertions May 7, 2026
@gsoldevila
Copy link
Copy Markdown
Member Author

We should fix the RC: registering things async

@gsoldevila gsoldevila closed this May 7, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #147 / Alerting APIs Alerting rules should pass updated rule params to executor
  • [job] [logs] FTR Configs #48 / integrations When on the Trusted Apps list should be able to add a new trusted app and remove it
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Home page - Enrich policies - renders the enrich policies tab

Metrics [docs]

✅ unchanged

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test: Dashboard add panel flyout - renders add panel flyout

2 participants